package simulator;

import java.util.Vector;

public class NodeList {
	
	private Vector iList;

	
	public NodeList () {
		iList = new Vector ();
	}
	
	public  void AddElement (Node aNode) {
		iList.addElement(aNode);
		
	}
	
	public Node GetFirstElement (){
		Node retvar;
		retvar = (Node) iList.firstElement();
		return retvar;
	}
	
	public Node GetLastElement () {
		Node retvar;
		retvar = (Node) iList.lastElement();
		return retvar;		
	}
	
	public void RemoveFirstElement () {
		iList.removeElementAt(0);
	}
	
	public synchronized void RemoveAllElements () {
		iList.removeAllElements();
	}

	public void cleanup() {
		iList.removeAllElements();
		iList = null; 		
	}
	
	public int size () {
		return iList.size();
	}


}
